package com.sdy.Cache;

import com.sdy.config.SpringContextHolder;
import org.apache.ibatis.cache.Cache;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * 使用Redis作为Mybatis的二级缓存
 */
public class MyBatisRedisCache implements Cache {

    //获得redistemplate对象
    private RedisTemplate<String,Object> redisTemplate = SpringContextHolder.getBean(RedisTemplate.class);

    @Override
    public String getId() {
        return null;
    }

    @Override
    public void putObject(Object o, Object o1) {

    }

    @Override
    public Object getObject(Object o) {
        return null;
    }

    @Override
    public Object removeObject(Object o) {
        return null;
    }

    @Override
    public void clear() {

    }

    @Override
    public int getSize() {
        return 0;
    }
}
